<template>
    <div class="song-list">
        <!-- <h3>歌单详情</h3> -->
        <van-nav-bar
        title="歌单详情"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"/>
       <div class="header">
            <img :src="song.logo" alt="">
            <h4>{{song.dissname}}</h4>
            <div class="nick">
                <img :src="song.headurl" alt="">
                <span>{{song.nickname}}</span>
            </div>
            <span>播放量:{{song.visitnum}}万</span>
        </div>
    </div>
</template>
<script>
export default{
        data(){
        return{
            song:{
                dissname:"",//标题
                logo:"",//歌单logo
                headurl:"",//歌单制作者头像
                nickname:"",//歌单制作者昵称
                visitnum:0,//歌单播放量
            },
        };
    },

    created(){
        this.getListData()
    },
    methods:{
        getListData(){
            this.$request('get','songlist?id'+this.$route.params.id)
            .then((res)=>{
                console.log(res);
                 this.song.dissname = res.data.dissname
                this.song.logo = res.data.logo
                this.song.headurl = res.data.headurl
                this.song.nickname = res.data.nickname
                this.song.vistnum = res.data.vistnum

            });
        },
        onClickLeft(){
            window.history.length > 1 ? this.$router.go(-1) : this.$router.push('/')
        }
    },

};
</script>
<style scoped>

</style>
